<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文章列表</title>
    <!-- 导入 layui css文件 -->
    <link rel="stylesheet" href="/assets/lib/layui/css/layui.css">
    <!-- 导入 自定义 css文件 -->
    <link rel="stylesheet" href="/assets/css/article/art_list.css">
</head>

<body>
    <div class="layui-card">
        <div class="layui-card-header">
            <span>文章列表</span>
        </div>
        <div class="layui-card-body">
            <!-- 筛选区 -->
            <form class="layui-form" id="form-search">
                <!-- 分类下拉框 -->
                <div class="layui-form-item layui-inline">
                    <select name="cate_id"></select>
                </div>
                <!-- 文章状态下拉框 -->
                <div class="layui-form-item layui-inline">
                    <select name="state" lay-verify="">
                        <option value="">所有状态</option>
                        <option value="已发布">已发布</option>
                        <option value="草稿">草稿</option>
                    </select>
                </div>
                <!-- 筛选按钮 -->
                <div class="layui-form-item layui-inline">
                    <button class="layui-btn" lay-submit>筛选</button>
                </div>
            </form>

            <!-- 分类表格 -->
            <table class="layui-table">
                <colgroup>
                    <col>
                    <col>
                    <col>
                    <col>
                    <col width="200">
                </colgroup>
                <!-- 表头 -->
                <thead>
                    <tr>
                        <th>文章标题</th>
                        <th>分类</th>
                        <th>发布时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <!-- 数据行 -->
                <tbody></tbody>
            </table>
            <!-- 分页 -->
            <div id="pageBar"></div>
        </div>
    </div>

    <!-- 表格模板结构 -->
    <script type="text/html" id="tpl-list">
        {{each data}}
            <tr>
                <td>{{$value.title}}</td>
                <td>{{$value.cate_name}}</td>
                <td>{{$value.pub_date|dataFormat}}</td>
                <td>{{$value.state}}</td>
                <td data-id="{{$value.Id}}">
                    <button type="button" class="layui-btn layui-btn-xs redact" data-id="{{$value.Id}}">编辑</button>
                    <button type="button" class="layui-btn layui-btn-danger layui-btn-xs remove"  data-id="{{$value.Id}}">删除</button>
                </td>
            </tr>
        {{/each}}
    </script>
    <!-- 文章模板结构 -->
    <script type="text/html" id="editArticle ">
    </script>

    <!-- 下拉列表模板结构 -->
    <script type="text/html" id="tpl-catelist">
        <option value="">请选择</option>
        {{each data}}
        <option value="{{$value.Id}}">{{$value.name}}</option>
        {{/each}}
    </script>



    <!-- 导入新版(v2.6.7)的layui JS文件 -->
    <script src="/assets/lib/layui/layui.js"></script>
    <!-- 加载 jquery -->
    <script src="/assets/lib/jquery.js"></script>
    <!-- 加载 公共js -->
    <script src="/assets/js/baseAPI.js"></script>
    <!-- 加载模板文件 -->
    <script src="/assets/lib/template-web.js"></script>
    <!-- 加载 用户js -->
    <script src="/assets/js/article/art_list.js"></script>
</body>

</html>